package com.slz3.business.module.wmsManagement.wmsStockDetailItems.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.wmsManagement.wmsStockDetailItems.domain.WmsStockDetailItems;
import com.slz3.business.module.wmsManagement.wmsStockDetailItems.domain.WmsStockDetailItemsCondition;
import org.springframework.stereotype.Controller;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

import javax.annotation.Resource;

public class WmsStockDetailItemsResController extends WmsStockDetailItemsResAtomic {

    public Mono<ServerResponse> add(ServerRequest req, WmsStockDetailItems wmsStockDetailItems) {
        if (WmsStockDetailItemsResUnsafeValid.add(req, wmsStockDetailItems)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.add_$WmsStockDetailItemsUpdateLock(req, wmsStockDetailItems);
        }
    }

    public Mono<ServerResponse> delete(ServerRequest req, WmsStockDetailItemsCondition wmsStockDetailItemsCondition) {
        if (WmsStockDetailItemsResUnsafeValid.delete(req, wmsStockDetailItemsCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.delete_$WmsStockDetailItemsUpdateLock(req, wmsStockDetailItemsCondition);
        }
    }

    public Mono<ServerResponse> modify(ServerRequest req, WmsStockDetailItems wmsStockDetailItems) {
        if (WmsStockDetailItemsResUnsafeValid.modify(req, wmsStockDetailItems)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.modify_$WmsStockDetailItemsUpdateLock(req, wmsStockDetailItems);
        }
    }

    public Mono<ServerResponse> list(ServerRequest req) {
        if (WmsStockDetailItemsResUnsafeValid.list(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.list(req);
        }
    }

    public Mono<ServerResponse> info(ServerRequest req) {
//        return wmsStockDetailItemsResAtomic.info_$WmsStockDetailItemsUpdateLock(req);
        if (WmsStockDetailItemsResUnsafeValid.info(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.info_$WmsStockDetailItemsUpdateLock(req);
        }
    }

    public Mono<ServerResponse> choice(ServerRequest req) {
        if (WmsStockDetailItemsResUnsafeValid.choice(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.choice(req);
        }
    }

    public Mono<ServerResponse> auditSubmit(ServerRequest req, WmsStockDetailItemsCondition wmsStockDetailItemsCondition) {
        //
        if (WmsStockDetailItemsResUnsafeValid.auditSubmit(req, wmsStockDetailItemsCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.auditSubmit_$WmsStockDetailItemsUpdateLock(req, wmsStockDetailItemsCondition);
        }
    }

    public Mono<ServerResponse> audit(ServerRequest req, WmsStockDetailItemsCondition wmsStockDetailItemsCondition) {
        if (WmsStockDetailItemsResUnsafeValid.audit(req, wmsStockDetailItemsCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.audit_$WmsStockDetailItemsUpdateLock(req, wmsStockDetailItemsCondition);
        }
    }

    public Mono<ServerResponse> auditReject(ServerRequest req, WmsStockDetailItemsCondition wmsStockDetailItemsCondition) {
        if (WmsStockDetailItemsResUnsafeValid.auditReject(req, wmsStockDetailItemsCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.auditReject_$WmsStockDetailItemsUpdateLock(req, wmsStockDetailItemsCondition);
        }
    }

    public Mono<ServerResponse> usingEnable(ServerRequest req, WmsStockDetailItemsCondition wmsStockDetailItemsCondition) {
        if (WmsStockDetailItemsResUnsafeValid.usingEnable(req, wmsStockDetailItemsCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.usingEnable_$WmsStockDetailItemsUpdateLock(req, wmsStockDetailItemsCondition);
        }
    }

    public Mono<ServerResponse> usingDisable(ServerRequest req, WmsStockDetailItemsCondition wmsStockDetailItemsCondition) {
        if (WmsStockDetailItemsResUnsafeValid.usingDisable(req, wmsStockDetailItemsCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.usingDisable_$WmsStockDetailItemsUpdateLock(req, wmsStockDetailItemsCondition);
        }
    }

}
